// app.js
App({
  onShow (options) {
    console.log("onShow")
  },
  onHide () {
    console.log("onHide")
  },
  onLaunch() {
    console.log("onLaunch")
    wx.getLocation({
      type: 'wgs84',
      success: (res) => {
        var latitude = res.latitude // 纬度
        var longitude = res.longitude // 经度
        console.log(res)
      },
      fail(e) {
        console.log(e)
      }
    })
  },
  http({ method = "GET", url, data = {} } = {}) {
    return new Promise((resolve, reject) => {
      wx.request({
        method,
        url,
        data,
        success(res) {
          resolve(res)
        },
        fail(e) {
          reject(e)
        }
      })
    })
  },
  // 共享数据
  globalData: {
    userInfo: null,
    scanCodeResult: null
  }
})
